package com.carrot.system.service.impl;

import com.carrot.common.core.domain.entity.SysTerminalInfo;
import com.carrot.common.exception.ServiceException;
import com.carrot.common.mybatis.BaseServiceImpl;
import com.carrot.system.mapper.SysTerminalInfoMapper;
import com.carrot.system.service.ITerminalInfoService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
public class TerminalInfoServiceImpl extends BaseServiceImpl<SysTerminalInfoMapper, SysTerminalInfo>
        implements ITerminalInfoService {


    @Override
    @Transactional(rollbackFor = ServiceException.class)
    public void addTerminalInfo(SysTerminalInfo terminalInfo) {

        this.save(terminalInfo);
    }

    @Override
    @Transactional(rollbackFor = ServiceException.class)
    public void updateTerminalInfo(SysTerminalInfo terminalInfo) {

        this.updateById(terminalInfo);
    }

    @Override
    @Transactional(rollbackFor = ServiceException.class)
    public void delTerminalInfo(Long id) {

        this.removeById(id);
    }

    @Override
    @Transactional(rollbackFor = ServiceException.class)
    public void batchDelTerminalInfo(List<Long> ids) {

        this.removeBatchByIds(ids);
    }
}
